#include "CH59x_common.h"

#ifndef _WS2812_DEFINE
#define _WS2812_DEFINE

#define			WS2812_GPIO_PIN				GPIO_Pin_11
#define WS2812_RESET_TIME  280
#define LED_NUMS  60

#define WS2812_LED_BIT 24
#define PIXEL_NUM       LED_NUMS
#define WS2812_RST_NUM	300
#define NUM             (WS2812_LED_BIT*PIXEL_NUM + WS2812_RST_NUM)        // Reset 280us / 1.25us = 224


#define WS1             45
#define WS0             30
#define WS2812_LED_DATA_0	 30
#define WS2812_LED_DATA_1  45

#define WS2812_LED_DATA_LEN NUM

enum {
	WS2812_LED_LEVEL_0 = 0,
	WS2812_LED_LEVEL_1,
	WS2812_LED_LEVEL_2,
	WS2812_LED_LEVEL_3,
	WS2812_LED_LEVEL_4,
	WS2812_LED_LEVEL_5,
	WS2812_LED_LEVEL_6,
	WS2812_LED_LEVEL_7,
	WS2812_LED_LEVEL_8,
	WS2812_LED_LEVEL_9,
	WS2812_LED_LEVEL_10,
	WS2812_LED_LEVEL_11,
	WS2812_LED_LEVEL_12,
	WS2812_LED_LEVEL_13,
	WS2812_LED_LEVEL_14,
	WS2812_LED_LEVEL_15,
	WS2812_LED_LEVEL
};

typedef struct
{
	uint8_t G;
	uint8_t R;
	uint8_t B;
	uint8_t phase;
}WS2812_LED_CTRL;

void ws281x_rainbowCycle(void);
void ws2812_Init(void);
void WS2812_LED_Circle(void);

#endif
